doseresNMA antidep/drnma.master.R

#!!!! fig3: class model is wrong, check jags model and plot: 
           # UPDATE19.01.2021: I fixed it but net.structure and drnma.plot.1absolute need some changes
# this file produces the plots and tables in the main text and appendix

# Note: I saved the plots manually 'save as pdf' 
         # and tables (view -> mark->copy/paste)
source('drnma.master.prep.R') # data needed to master files

# ----------------- Main-text figures ----------------- #

# Figure 1: network 
ggsave('fig1.pdf',net.plot(),
       width=8.27,
       height=11.69)

# Figure 2: standard (M1) and sutudy-year (M3) absolute response
ggsave('fig2.pdf',
       absolutePredplot2(m=drnma_RE,m2=drnma_year),
       width=9.5,
       height=11)

# Figure 3: class absolute resopnse (M5) 
ggsave('fig3.pdf',
       absolutePredplot(drnma_class,data = antidep_class,drug.lab=levels(antidep_class$class),nd=100),
       width=9.5,
       height=11)
#absolutePredplot(x=drnma_RE,data=antidep,drug.lab = levels(antidep$drug))


# Table 3: tau, %drop in tau^2, g (reg coef) and DIC
tab.comp()
# ----------------- Appendix figures and tables ----------------- #

# Appendix Figure 1: splitted network
ggsave('App fig1.pdf',split.net.plot())
# Appendix Figure 2: NMR(RoB, M2) absolute response 
ggsave('App fig2.pdf',
       absolutePredplot(m=drnma_rob,drug.lab=levels(antidep$drug)),
       width=9.5,
       height=11)
# Appendix Figure 3: NMR(var logOR, M4) absolute response 
ggsave('App fig3.pdf',
       absolutePredplot(m=drnma_var,drug.lab=levels(antidep$drug)),
       width=9.5,
       height=11)
# Appendix Figure 4: forest plot (M1): estimate + CrI for the two coef
ggsave('App fig4.pdf',
       forestplot(m=drnma_RE),
       width=9.5,
       height=11)
# Appendix Figure 5: fit plot (M1)
ggsave('App fig5.pdf',
       fitplot(drnma_RE),
       width=9.5,
       height=11)
# Appendix Figure 6: dose distribution per drug
ggsave('App fig6.pdf',dose_dist())
# Appendix Figure 7: sensitivity analysis: knots at 10%, 20% and 30% percentiles
ggsave('App fig7.pdf',
       absolutePredplot(m=drnma_RE_sens),
       width=9.5,
       height=11)
# Appendix Table 1: characterstics per drug
View(net.tab())
# Appendix Table 2: convergence measures: Rhat and effective sample size
View(converge.table())
# Appendix Table 3: estimated coef 1 per drug
View(coef.table()[[1]])
# Appendix Table 4: estimated coef 2 per drug
View(coef.table()[[2]])
htx-r/doseresNMA documentation built on Jan. 28, 2021, 5:32 a.m.